package _07static关键字;

public class Point {
	
	// 实例成员变量
	private int x;
	private int y;
	
	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	static int count;
	
	public Point() {
		count++;
	}

	public Point(int x, int y) {
		super();
		this.x = x;
		this.y = y;
	}

	// 变成类的成员变量
	static int z;
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return (x+" "+y+" "+z);
	}
	
	// 静态方法
	static void foo() {
		System.out.println(z);
	}
	
//	static double getDistance(double x, double y) {
//		return Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
//	}
	
	static double getDistance(Point x, Point y) {
		double result=0;
		result=Math.sqrt(Math.pow(Math.abs(x.getX()-y.getX()), 2)+Math.pow(Math.abs(x.getY()-y.getY()), 2));
		
		return result;
		
	}
	
	void cCount() {
		Point.count++;
	}
	
}
